<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<html>
<head>
<title>渠道统计</title>
</head>
<body>
<script type="text/javascript">
	function exportExcel(state){
		$("#state").val(state);
		$("#mallForm").attr("action","batchExcel.do");
		$("#mallForm").sumbit();
	}
	function exportExcelByMonth(){
		$("#mallForm").attr("action","batchMonthExcel.do");
		$("#mallForm").sumbit();
	}
	
	
</script>
<jsp:include page="_headChannel.jsp"></jsp:include>
 <form class="form-inline" action="" method="get" id="mallForm">
 <input type ="hidden" name ="state" id="state" value ="" />
 <%-- 从<div class="datepicker input-append">
    <input data-format="yyyy-MM-dd" type="text" value="${beginDate}" name="beginDate"></input>
    <span class="add-on">
      <i data-time-icon="icon-time" data-date-icon="icon-calendar">
      </i>
    </span>
  </div>
  到
  <div class="datepicker input-append">
    <input data-format="yyyy-MM-dd" type="text" value="${endDate}" name="endDate"></input>
    <span class="add-on">
      <i data-time-icon="icon-time" data-date-icon="icon-calendar">
      </i>
    </span>
  </div> --%>

日期:
<div class="datepicker input-append">
    <input data-format="yyyy-MM-dd" type="text" value="${selectDate}" name="selectDate"></input>
    <span class="add-on">
      <i data-time-icon="icon-time" data-date-icon="icon-calendar">
      </i>
    </span>
  </div>

  <button type="submit" class="btn">查询</button>
  
  <button type="submit" class="btn" onClick="exportExcel('month');">导出本月数据报表</button>
  <button type="submit" class="btn" onClick="exportExcel('year');">导出本年数据报表</button>
  
  <button type="submit" class="btn" onClick="exportExcelByMonth();">导出指定月份数据报表</button>
</form>
<table class="table table-bordered">
	<thead>
		<tr>
		<th>日期</th>
		<th>渠道名称</th> 
		<th>点击次数</th> 
		<th>ip点击次数</th> 
		<th>注册人数</th> 
		<th>创角色</th> 
		<th>总登录</th> 
		<th>新用户登录</th> 
		<th>老用户登录</th> 
		<th>充值人数</th> 
		<th>充值金额(￥)</th> 
		<th></th> 
		</tr>
	</thead>
	<tbody id="channel_body_id">
		<c:forEach var="data" items="${countData}">
		<c:if test="${data.channelId != 1 || data.channelId != 4 || data.channelId != 5}">
		<tr>
			<td >${data.genDate}</td>
			<td >${channelMap.get(data.channelId) }(id:${data.channelId})</td>
			<td >${data.visitTimes}</td>
			<td >${data.channelIpCount}</td>
			<td >${data.registerNum}</td>
			<td >${data.newRoleNum}</td>
			<td >${data.newLogin + data.oldLogin}</td>
			<td >${data.newLogin}</td>
			<td >${data.oldLogin}</td>
			<td >${data.chargeNum}</td>
			<td >${data.gold}</td>
			<td>
				<c:set var="keyStr" value="${data.genDate }_${data.channelId }"></c:set>
				<c:set var="openSet" value="${openMap.get(keyStr).entrySet()}"></c:set>
				<c:if test="${!empty openSet}">
				<table class="table table-bordered">
					<thead>
						<tr>
						<th>注册方式</th> 
						<th>注册数量</th> 
						</tr>
					</thead>
					<tbody id="open_body_id">
						<c:forEach var="open" items="${openSet}">
						<tr>
							<td >${OPEN_CONFIG.get(open.key)}</td>
							<td >${open.value}</td>
						</tr>
						</c:forEach>
					</tbody>
				</table>
				</c:if>
			</td>
		</tr>
		</c:if>
		</c:forEach>
	</tbody>
</table>

</body>
</html>
 